package com.controller.api;

import com.biz.ActPhotoUrlBiz;
import com.biz.NewsBiz;
import com.controller.backend.BaseController;
import com.core.Result;
import com.core.ResultGenerator;
import com.entity.model.ActPhotoUrl;
import com.entity.model.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;

import java.util.List;

/**
 * Created by jc on 2019/11/16.
 */
@RestController("apiActPhotoUrlController")
@RequestMapping("/api/actPhotoUrl")
public class actPhotoUrlController extends BaseController<ActPhotoUrl> {
    @Autowired
    private ActPhotoUrlBiz actPhotoUrlBiz;


    //首页广告列表
    @RequestMapping(value = "/actPhotoList")
    public Result list() {
        Condition condition = new Condition(News.class);
        condition.createCriteria().andEqualTo("id", 1);
        ActPhotoUrl actPhotoUrl = actPhotoUrlBiz.findByCondition(condition).get(0);
        return ResultGenerator.genSuccessResult(actPhotoUrl);
    }

}
